using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using _7tc056_QuanLyNhaSach.HeThongLuuTru;
using _7tc056_QuanLyNhaSach.HeThongXuLy;

namespace _7tc056_QuanLyNhaSach.HeThongLuuTru
{
    class ThamSoDAO
    {
        public static DataTable GetThamSoAll()
        {
            string sql = "select * from THAMSO";
            return DataAssecc.ExecQuery(sql);
        }
        static public DataTable SelectSoLuongTon(int masach)
        {
            string sql = "select * from SACH where MaSach=" + masach;
            return DataAssecc.ExecQuery(sql);
        }
        
        static public void Update(ThamSoDTO ts)
        {
            string sql = "update THAMSO set SoLuongNhapToiThieu=(" + ts.SoLuongNhapToiThieu + "),SoLuongTonToiDa=(" + ts.SoLuongTonToiDa + "),TienNoQD=(" + ts.TienNoQD + "),SoSachTonQD=(" + ts.SoSachTonQD + ")where MaThamSo = " + ts.MaThamSo + "";
            DataAssecc.ExecNonQuery(sql);
        }

    }
}
